<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

//文章管理
Route::group(['prefix' => 'article'], function () {
    Route::post('/create', 'Api\ArticleController@createArticle');
    Route::post('/{id}/delete', 'Api\ArticleController@deleteArticle');
    Route::post('/{id}/update', 'Api\ArticleController@updateArticle');
    Route::get('/list', 'Api\ArticleController@getArticleList');
});
//文章分类管理
Route::group(['prefix' => 'article/class'], function () {
    Route::post('/create', 'Api\ArticleController@createArticleClass');
    Route::post('/{id}/delete', 'Api\ArticleController@deleteArticleClass');
    Route::post('/{id}/update', 'Api\ArticleController@updateArticleClass');
    Route::get('/list', 'Api\ArticleController@getArticleClassList');
});
//文章评论
Route::group(['prefix' => 'article/comment'], function () {
    Route::post('/create', 'Api\ArticleCommentController@createArticleComment');
    Route::post('/{id}/delete', 'Api\ArticleCommentController@deleteArticleComment');
    Route::post('/{id}/update', 'Api\ArticleCommentController@updateArticleComment');
    Route::get('/list', 'Api\ArticleCommentController@getArticleCommentList');
});
